# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-convert-pem
_pkgname=Convert-PEM
pkgver=0.08
pkgrel=16
pkgdesc='Read/write encrypted ASN.1 PEM files.'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl' 'perl-class-errorhandler' 'perl-convert-asn1>=0.10'
         'perl-crypt-des_ede3')
makedepends=('perl-test-exception' 'perl-module-install')
url='http://search.cpan.org/dist/Convert-PEM'
source=("http://search.cpan.org/CPAN/authors/id/B/BT/BTROTT/$_pkgname-$pkgver.tar.gz")
sha512sums=('d5e4342b40d01d534ec5f81ab009af185f795267c1bce792d26739ab07078a618093c720230ac2b6cf10c4b5ae1c282c94afa5b9db2eef6fd66e684d2080c273')
_distdir="$_pkgname-$pkgver"

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd "$_distdir"

    /usr/bin/perl Makefile.PL
    make
  )
}

package() {
  cd "$_distdir"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

